﻿@{
    ViewBag.Title = "ListTasks";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    任务列表</h2>
<table>
    <thead>
        <tr>
            <th>
                任务id
            </th>
            <th>
                任务名称
            </th>
        </tr>
    </thead>
    <tbody>
    @{
        foreach(var task in ViewBag.Tasks)
        {
          <tr>
            <td>
            @task.Id
            </td>
            <td>
            @task.Name
            </td>
        </tr>
        }
        }
    </tbody>
    <tfoot>
        <tr>
            <td colspan="2">
            @{
                    foreach(var page in ViewBag.Pages){
                        if(page.IsCurrentPage){
                            <span>【@page.PageNum】</span>
                        }else{
                        <a href="@page.PageLink">【@page.PageNum】</a>
                         }
                    } 
                }
                共<font color='red'>@ViewBag.Records</font>条数据 分为<font color='red'>@ViewBag.PageCount</font>页
            </td>
        </tr>
    </tfoot>
</table>
